package view;

import java.awt.Dimension;
import java.awt.event.ActionEvent;

import javax.swing.JButton;

import javax.swing.WindowConstants;
import org.jdesktop.application.Action;
import org.jdesktop.application.Application;
import org.jdesktop.application.ApplicationActionMap;

import javax.swing.AbstractAction;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;

/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class PanelModEmp extends javax.swing.JPanel {

	private static PanelModEmp instancia;
	private JButton jButton1;
	private JButton jButtonCancelar;
	private JLabel jLabel2;
	private JLabel jLabel1;
	private JTextField jTextFieldIDEmp;
	private AbstractAction actionBuscEmpI;
	private AbstractAction actionCancelar;
	
	public static PanelModEmp getInstancia(){
		if(instancia==null){
			instancia=new PanelModEmp();
		}
		return instancia;
	}
	
	private PanelModEmp() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			this.setSize(400, 219);
			this.setLayout(null);
			this.add(getJButton1());
			this.add(getJTextFieldIDEmp());
			this.add(getJLabel1());
			this.add(getJLabel2());
			this.add(getJButtonCancelar());
			Application.getInstance().getContext().getResourceMap(getClass()).injectComponents(this);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	private JButton getJButton1() {
		if(jButton1 == null) {
			jButton1 = new JButton();
			jButton1.setBounds(240, 12, 95, 21);
			jButton1.setName("jButton1");
			jButton1.setAction(getActionBuscEmp());
		}
		return jButton1;
	}
	
	
	private JTextField getJTextFieldIDEmp() {
		if(jTextFieldIDEmp == null) {
			jTextFieldIDEmp = new JTextField();
			jTextFieldIDEmp.setBounds(146, 12, 82, 21);
		}
		return jTextFieldIDEmp;
	}
	
	
	private AbstractAction getActionBuscEmp() {
		if(actionBuscEmpI == null) {
			actionBuscEmpI = new AbstractAction("Buscar", null) {
				public void actionPerformed(ActionEvent evt) {
					//TBD
				}
			};
		}
		return actionBuscEmpI;
	}
	
    /**
    * Returns the action map used by this application.
     * Actions defined using the Action annotation
     * are returned by this method
     */
	private ApplicationActionMap getAppActionMap() {
		return Application.getInstance().getContext().getActionMap(this);
	}
    
    private JLabel getJLabel1() {
    	if(jLabel1 == null) {
    		jLabel1 = new JLabel();
    		jLabel1.setBounds(190, 64, 79, 14);
    		jLabel1.setName("jLabel1");
    	}
    	return jLabel1;
    }
    
    private JLabel getJLabel2() {
    	if(jLabel2 == null) {
    		jLabel2 = new JLabel();
    		jLabel2.setBounds(53, 15, 75, 14);
    		jLabel2.setName("jLabel2");
    	}
    	return jLabel2;
    }
    
    private JButton getJButtonCancelar() {
    	if(jButtonCancelar == null) {
    		jButtonCancelar = new JButton();
    		jButtonCancelar.setBounds(293, 187, 96, 21);
    		jButtonCancelar.setName("jButtonCancelar");
    		jButtonCancelar.setAction(getActionCancelar());
    	}
    	return jButtonCancelar;
    }

    private AbstractAction getActionCancelar() {
		if(actionCancelar == null) {
			actionCancelar = new AbstractAction("Cancelar", null) {
				public void actionPerformed(ActionEvent evt) {
					instancia.setVisible(false);
				}
			};
		}
		return actionCancelar;
	}
}
